<div class="yuList">            
    <table class="change-order">
        <thead>
            <tr>
                <th>变更单号</th>
                <th>拍单号</th>
                <th>车辆编号</th>
                <?php if ($params['status'] != 0): ?>
                <th>变更原因</th>
                <?php endif ?>
                <th>车牌号</th>
                <th>发起人</th>
                <?php if ($params['status'] == 0): ?>
                    <th>创建时间</th>
                <?php elseif($params['status'] == 1): ?>
                    <th>处理时间</th>
                <?php elseif($params['status'] == 2): ?>
                    <th>完成时间</th>
                <?php elseif($params['status'] == 3): ?>
                    <th>拒绝时间</th>
                <?php elseif($params['status'] == 4): ?>
                    <th>作废时间</th>
                <?php endif ?>
                <th>操作</th>             
            </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo" key="k">
            <tr>
                <td>{$vo.modify_no}</td>
                <td>{$vo.order_no}</td>
                <td>{$vo.sno}</td>
                <?php if ($params['status'] != 0): ?>
                <td>{$modify_reason[$vo['modify_reason']]}</td>
                <?php endif ?>
                <td>{$vo.car_plate_number}</td>
                <td>{$vo.real_name}</td>
                <?php if ($params['status'] == 0): ?>
                    <th>{$vo.createtime}</th>
                <?php elseif($params['status'] == 1): ?>
                    <th>{$vo.dealtime}</th>
                <?php elseif($params['status'] == 2): ?>
                    <th>{$vo.completetime}</th>
                <?php elseif($params['status'] == 3): ?>
                    <th>{$vo.refusetime}</th>
                <?php elseif($params['status'] == 4): ?>
                    <th>{$vo.canceltime}</th>
                <?php endif ?>
                <td>
                    <?php if ($params['status'] == 0): ?>
                        <a href="/changeOrder/deal/mid/{$vo.mid}">处理</a>
                        <?php if ($vo['is_show_invalid']): ?>
                            <a href="/ChangeOrder/voidDetail/mid/{$vo.mid}" target="_black">作废</a>
                        <?php endif ?>
                        <a href="/changeOrder/detail/mid/{$vo.mid}" target="_black">查看</a>
                    <?php elseif ($params['status'] == 1): ?>
                        <?php if ($vo['is_show_invalid']): ?>
                            <a href="/ChangeOrder/voidDetail/mid/{$vo.mid}" target="_black">作废</a>
                        <?php endif ?>
                        <a href="javascript:" onclick="refusal_execute({$vo.mid})">拒绝执行</a>
                        <a href="/changeOrder/detail/mid/{$vo.mid}" target="_black">查看</a>
                    <?php elseif ($params['status'] == 2): ?>
                        <a href="/changeOrder/detail/mid/{$vo.mid}" target="_black">查看</a>
                    <?php elseif ($params['status'] == 3): ?>
                        <?php if ($vo['is_show_invalid']): ?>
                            <a href="/ChangeOrder/voidDetail/mid/{$vo.mid}" target="_black">作废</a>
                        <?php endif ?>
                        <a href="/changeOrder/detail/mid/{$vo.mid}" target="_black">查看</a>
                    <?php elseif ($params['status'] == 4): ?>
                        <a href="/changeOrder/detail/mid/{$vo.mid}" target="_black">查看</a>
                    <?php endif ?>
                </td>
            </tr>
        </volist>
        </tbody>
    </table>
    <div class="pageFaye"><div class="pager">{$page}</div><div class="clear"></div></div>
</div>
<!--作废-->
<!-- <div class="chenggong1">
    <span class="paidan">您确定要变更单作废吗?</span>
    <div class="shenhei-btn">
        <input type="hidden" name="cancel_mid"  value="" />
        <input type="button" value="确定" class="voiddetermine" />
        <input type="button" value="取消" class="cancel" />
    </div>
</div> -->
<script>
    function modifylist_cancel(mid){
        confirm_alert('<div style="color:red">您确定要变更单作废吗</div>', function () {
            $(".determine").on('click', function () {
                var param = {
                    'mid':mid
                };
                var btn_obj = $(this);
                btn_obj.val("提交中...").attr("disabled",'disabled');
                $.post('/changeOrder/modifylist_cancel', param, function (data) {
                    if (data.code == '200') {
                        btn_alert(data.msg);
                        btn_obj.val("确定").removeAttr("disabled style");
                        colse_hide();
                    } else {
                        shibai_alert(data.msg, 500, function(){
                            colse_hide();
                        });
                        btn_obj.val("确定").removeAttr("disabled style");
                    }
                }, 'json');
            });
        })
    }
    

    function refusal_execute(mid){
        confirm_alert('<div style="color:red">您确定要变更单拒绝执行吗</div>', function () {
            $(".determine").on('click', function () {
                var param = {
                    'mid':mid
                };
                var btn_obj = $(this);
                btn_obj.val("提交中...").attr("disabled",'disabled');
                $.post('/changeOrder/refuse_execute', param, function (data) {
                    if (data.code == '200') {
                        btn_alert(data.msg);
                        btn_obj.val("确定").removeAttr("disabled style");
                        colse_hide();
                        window.location.reload();
                    } else {
                        shibai_alert(data.msg, 500, function(){
                            colse_hide();
                        });
                        btn_obj.val("确定").removeAttr("disabled style");
                    }
                }, 'json');
            });
        })
    }
    // $(".cancel").on('click', function () {
    //     $('.chenggong1').fadeOut();
    //     $('.yunBei').css({'display':'none',"zIndex":999});
    // });

    //  function again_change(change_id) {
    //     confirm_alert('<div style="color:red">您确定再次变更吗？</div>', function () {
    //         $(".determine").click(function () {
    //             $.post('/ChangeOrder/againChange',{change_id:change_id},function (data) {
    //                 if(data.code != 200){
    //                     shibai_alert(data.msg, 500, function(){
    //                         colse_hide();
    //                     });
    //                     return ;
    //                 }
    //                 colse_hide();
    //                 btn_alert("操作成功", 500, function () {
    //                     window.location.href="/ChangeOrder/again_change_detail/mid/"+change_id;
    //                 });
    //             },'json');
    //         })
    //     });
    // }
</script>